package com.twu.biblioteca;

import java.io.IOException;

/**
 * Created by abhishekpuri on 10/7/14.
 */
public class Main {
    public static void main(String[] args) {
        BibliotecaApp ba=new BibliotecaApp();
        Menu menu = new Menu();
        ba.printWelcomeMessage();
        int optionNumber=0;
        while(optionNumber!=4) {
            menu.showMenuOptions();
            optionNumber=menu.readUserInput();
            if(optionNumber!=4) {
                ba.performSelectedOption(optionNumber);
                IOHandler ioHandler = new IOHandler();
                ioHandler.printlnToConsole("Press enter to continue...");
                try {
                    System.in.read();
                }
                catch(IOException ex) {
                    ioHandler.printToErrorLog("BibAppErr : "+ex.getMessage());
                }
            }
        }
    }

}
